Skip to main content
This forum is closed to new posts and responses. The content has been migrated to the Digital Solutions Community. Please join us there for new content as well as this content. For customer support, please visit the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

HCL Notes/Domino 8.5 Forum (includes Notes Traveler)

Previous Next
Subject: LS2J using Java Library with Notes Java Classes
Feedback Type: Problem
Product Area: Domino Designer on Eclipse (DDE)
Technical Area: Application Development
Platform: Windows
Release: 8.5.2
Reproducible: Always

I have created a Java Library through the Designer client and am attempting to use LS2J to access it. The LotusScript part is correct and seems to work fine, it is the Java Library itself which is throwing an error.

Here is the LotusScript code snippet:
Dim jSession As JavaSession
Dim jClass As JavaClass
Dim jObj As JavaObject
...
Set jSession = New JavaSession()
Set jClass = jSession.GetClass("globalSpreadsheet")
Set jObj = jClass.CreateObject
returnText = jObj.validateSpreadsheet(fileName)

Here is the Java code snippet:
import lotus.domino.*;
import java.io.*;
import java.util.*;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;

public class globalSpreadsheet extends AgentBase {

Session s;
AgentContext agentContext;
Database db;
Document doc;
Document docKey;
View viewKey;
String searchKey;
String keywordValue;
String templateVersion;
String currentTemplate;
String output;
int sepPos;
int checkRow;
short checkColumn;

InputStream input = null;

// Constants...
String delimiter = "~~";

public String validateSpreadsheet(String detachFilePath) {
try {
// Get the Notes objects...
System.out.println("START");
s = getSession();

agentContext = s.getAgentContext();

db = agentContext.getCurrentDatabase();

output = "";


......


return output;
}
catch(Exception e) {
e.printStackTrace();
return output;
}
}
}

I cannot get the "START" to appear in the Java Console. I just get this error:
java.lang.NullPointerException
at globalSpreadsheet.validateSpreadsheet(globalSpreadsheet.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at lotus.domino.JavaConnectInvoker.invoke(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:600)
at lotus.domino.JavaConnectLoader.invoke(Unknown Source)

I found this post, but it didn't fix the error:
http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/3d8f187dc85ac69b852576580016fa65?OpenDocument

Can I not use "extends Agent Base" in the class? Do I have to use different classes (NotesFactory) to get the Notes classes (Session, Database, etc.)?

Any help would be great.

Thanks!
Dan


Feedback number WEBB8DGRF8 created by ~Fred Xanjumimarakoi on 01/26/2011

Status: Open
Comments:

LS2J using Java Library with Notes ... (~Fred Xanjumima... 26.Jan.11)
. . Far as I know you can *not* extend ... (~Zelda Ekresask... 27.Jan.11)




Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS